package com.managermype.domain;

import java.security.Principal;
import java.util.Calendar;
import java.util.HashSet;
import java.util.Set;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

@Repository
public class User implements Principal {

	private Integer idUser;
	private String username;
	private String password;
	private String firstname;
	private String lastname;
	private String motherLastname;
	private Calendar birthdate;
	private String identity;
	private char gender;// M:male, F:female
	private boolean active;

	@Autowired
	private Enterprise myEnterprise;

	@Autowired
	private Set<Role> myRoles = new HashSet<Role>();

	@Autowired
	private Departament myDepartament;

	public Integer getIdUser() {
		return idUser;
	}

	public void setIdUser(Integer idUser) {
		this.idUser = idUser;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getFirstname() {
		return firstname;
	}

	public void setFirstname(String firstname) {
		this.firstname = firstname;
	}

	public String getLastname() {
		return lastname;
	}

	public void setLastname(String lastname) {
		this.lastname = lastname;
	}

	public String getMotherLastname() {
		return motherLastname;
	}

	public void setMotherLastname(String motherLastname) {
		this.motherLastname = motherLastname;
	}

	public Calendar getBirthdate() {
		return birthdate;
	}

	public void setBirthdate(Calendar birthdate) {
		this.birthdate = birthdate;
	}

	public String getIdentity() {
		return identity;
	}

	public void setIdentity(String identity) {
		this.identity = identity;
	}

	public char getGender() {
		return gender;
	}

	public void setGender(char gender) {
		this.gender = gender;
	}

	public boolean isActive() {
		return active;
	}

	public void setActive(boolean active) {
		this.active = active;
	}

	public Enterprise getMyEnterprise() {
		return myEnterprise;
	}

	public void setMyEnterprise(Enterprise myEnterprise) {
		this.myEnterprise = myEnterprise;
	}

	public Set<Role> getMyRoles() {
		return myRoles;
	}

	public void setMyRoles(Set<Role> myRoles) {
		this.myRoles = myRoles;
	}

	public Departament getMyDepartament() {
		return myDepartament;
	}

	public void setMyDepartament(Departament myDepartament) {
		this.myDepartament = myDepartament;
	}

	@Override
	public String getName() {
		// TODO Auto-generated method stub
		return null;
	}

}
